﻿$(function () {
    ajaxCall('../DataService.asmx/GetSpeakersForCurrent', false, "",
            function (msg) {
                if (msg.d == null) {
                    $('#speakers').html("Speakers to be added soon...");
                }
                else {
                    for (i in msg.d) {
                        var speakers = [
                            { ID: msg.d[i].ID, FirstName: msg.d[i].FirstName, LastName: msg.d[i].LastName, CompanyName: msg.d[i].CompanyName, Country: msg.d[i].Country, ExpertIn: msg.d[i].ExpertIN, Link: msg.d[i].Link, Description: msg.d[i].Description }
                        ];

                        $('#SpeakerTemplate').tmpl(speakers).appendTo('#speakers');
                    }
                }
            },
            function () {
                alert("Error happend while reading data from database");
            }
        );
});
